<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div {
            background-color: #0000ff;
            border: 10px solid red;
            /*设置4个内边距*/
            padding: 20px
        }

        .class1 {
            margin-bottom: 50px;
        }

        .class2 {
            /*外边距取值，取两个元素之间最大的外边距值，而不是叠加*/
            /*margin-top: 100px;*/
            margin: auto;
            width: 500px;
        }
    </style>
</head>
<body>
<div class="class1">div标签1</div>
<div class="class2">div标签2</div>
<div>div标签3</div>
<div>div标签4</div>
</body>
</html>